function hardware_ = gXfine_hardware(varargin)

if nargin
    rootArgs = varargin{1};
else
    error(sprintf('%s needs arguments', mfilename));
end

% blink filter parameters:
%   these units are pretty raw:
BF.n = 5; % number of frames
BF.lowP = 0; % unknown units
BF.deltaP = 10; % unknown units per frame
BF.deltaH = 650; % point-of-gaze-units*100 per frame
BF.deltaV = 650; % point-of-gaze-units*100 per frame

if rootArgs.mouseMode
    disp(sprintf('\ndXasl in mouseMode (%s)\n', mfilename))
end
arg_dXasl = { ...
    'mouseMode',    rootArgs.mouseMode, ...
    'freq',         120, ...
    'blinkParams',  BF, ...
    'aslRect',      [-2032, 1532, 4064, -3064], ...
    'showPlot',     true, ...
    'showPtr',      {{'dXdots'};{'dXtarget'}}};

arg_dXbeep = { ...
    'mute',         false, ...
    'frequency',    {195.9975, 391.995, 783.99}, ...
    'duration',     .100, ...
    'gain',         {.8 .2 .2}};

arg_dXsound = { ...
    'mute',         false, ...
    'rawSound',     'Coin.wav', ...
    'gain',         .7};

% scan 4 analog inputs (vs. ground) at 1000Hz
%   mode = 1 means +/-10V
chans = 8:11;
nc = length(chans);
modes = ones(size(chans));
f = 1000;
[load, loadID] = formatPMDReport('AInSetup', chans, modes);
[start, startID] = formatPMDReport('AInScan', chans, f);
[stop, stopID] = formatPMDReport('AInStop');

% tell HIDx which channels are in use
cc = num2cell(chans);
[PMDChans(1:nc).ID]      = deal(cc{:});

% covert integers to decimal Voltages and divide out internal gain
gc = num2cell(0.01./2);
[PMDChans(1:nc).gain]	= deal(gc{:});

[PMDChans(1:nc).offset]	= deal(0);
[PMDChans(1:nc).high]	= deal(nan);

% only report lever state changes
%   i.e. crossing the +3V line
[PMDChans(1:nc).low]     = deal(3);
[PMDChans(1:nc).delta]	= deal(.5);

% convert serial numbers to sample times
[PMDChans(1:nc).freq]	= deal(f);

arg_dXPMDHID = { ...
    'HIDChannelizer',   PMDChans, ...
    'loadID',           loadID, ...
    'loadReport',       load, ...
    'startID',          startID, ...
    'startReport',      start, ...
    'stopID',           stopID, ...
    'stopReport',       stop};

arg_dXfeedback = { ...
    'groupName',        'iti', ...
    'doEndTrial',       'block', ...
    'size',             22, ...
    'bold',             true, ...
    'x',                -16, ...
    'tasksColor',       [1 1 0]*255, ...
    'totalsColor',      [1 1 0]*255, ...
    'displaySecs',      6e2, ...
    'preBlank',         false, ...
    'postBlank',        true};

% {'group', reuse, set now, set always}
static = {'root', true, true, false};
hardware_ = { ...
    'dXasl',        1,  static, arg_dXasl; ...
    'dXbeep',       3,  static, arg_dXbeep; ...
    'dXsound',      1,  static, arg_dXsound; ...
    'dXPMDHID',     1,  static, arg_dXPMDHID; ...
    'dXfeedback',	1,	static, arg_dXfeedback; ...
    };